

from django.db import models


class xiangmu_user(models.Model): #用户

    user_img_url=models.CharField(max_length=255,blank=True, null=True, db_comment='用户头像地址')
    user_name=models.CharField(max_length=255,blank=True, null=True, db_comment='用户姓名')
    user_mobile=models.CharField(max_length=255,blank=True, null=True, db_comment='用户手机号')
    loging_time = models.DateTimeField(verbose_name='项目上传时间日期', auto_now_add=True, null=True)
    xiangmu_img=models.FileField(verbose_name='项目图片地址', upload_to='xiangmuimgs/',blank=True, null=True, db_comment='项目图片地址')
    is_on_root = models.IntegerField(db_comment='0', default=0)
    weixin_openid = models.CharField(max_length=255,blank=True, null=True, db_comment='微信openid')
    user_root = models.CharField(max_length=255,blank=True, null=True, db_comment='负责人')
    root = models.CharField(max_length=255,blank=True, null=True, db_comment='负责人')
    user_admin = models.CharField(max_length=255,blank=True, null=True, db_comment='代理')
    admin = models.CharField(max_length=255,blank=True, null=True, db_comment='代理人')
    weixin_code = models.CharField(max_length=255, blank=True, null=True, db_comment='微信code')
    is_on_sale = models.IntegerField(db_comment='0', default=0)
    beiyong = models.CharField(max_length=255, blank=True, null=True, db_comment='备用字段')


    class Meta:
        managed = True
        db_table = 'xiangmu_user'
class xiangmu(models.Model):#项目
    xiangmu_name = models.CharField(max_length=255,blank=True, null=True, db_comment='项目名称')
    xiangmu_gongshi=models.CharField(max_length=255,blank=True, null=True, db_comment='项目公司')
    xiangmu_jieshao = models.TextField(blank=True, null=True, db_comment='项目简介')
    xiangmu_yaoqiu = models.TextField(blank=True, null=True, db_comment='项目要求')
    xiangmu_img = models.FileField(verbose_name='项目图片地址', upload_to='xiangmuimgs/', blank=True, null=True,
                                   db_comment='项目图片地址')
    is_on_modibo=models.IntegerField(db_comment='0',default=0)
    cid=models.ForeignKey(xiangmu_user,on_delete=models.CASCADE,)
    xiangmu_time=models.CharField(verbose_name='项目上传时间日期', max_length=255,blank=True, null=True)
    is_on_img=models.IntegerField(db_comment='0',default=0)
    is_on_text=models.IntegerField(db_comment='0',default=0)

    class Meta:
        managed = True
        db_table = 'xiangmu'

class xiangmu_chanyu(models.Model):
    xiangmu_name = models.CharField(max_length=255, blank=True, null=True)
    xiangmu_canyuimg=models.CharField(max_length=255, blank=True, null=True, db_comment='项目图片地址')
    xiangmu_shoujiimg=models.CharField(max_length=255, blank=True, null=True, db_comment='项目图片地址')
    xiangmu_lianjie=models.TextField(blank=True, null=True, db_comment='项目链接')
    xiangmu_time=models.DateTimeField(verbose_name='参加时间日期', auto_now_add=True, null=True)
    xiangmu_tuandui = models.CharField(max_length=255, blank=True, null=True, db_comment='项目团队')
    xiangmu_daili = models.CharField(max_length=255, blank=True, null=True, db_comment='项目代理')
    user_mobile = models.CharField(max_length=255, blank=True, null=True)
    cid = models.ForeignKey(to=xiangmu_user, on_delete=models.CASCADE,db_comment='用户')
    sid = models.ForeignKey(to=xiangmu, on_delete=models.CASCADE,db_comment='项目')

    xiangmu_gongshi = models.CharField(max_length=255, blank=True, null=True, db_comment='项目公司')
    xiangmu_wancheng = models.CharField(max_length=255, blank=True, null=True, db_comment='项目完成情况')
    is_on_chanyu = models.IntegerField(db_comment='0',default=0)
    is_on_shouji = models.IntegerField(db_comment='0',default=0)
    class Meta:
        managed = True
        db_table = 'xiangmu_chanyu'



